#pragma once
#include <qdialog.h>
#include <qstring.h>
#include <qbytearray.h>
#include <qlineedit.h>
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qgridlayout.h>
#include <qmessagebox.h>
#include <qcombobox.h>
#include <HupProtocal/HupProtocal.h>
#include <CmdJsonManager/CmdJsonManager.h>

class CmdSettingDialogSingleton :public QDialog
{
	Q_OBJECT
public:
	static CmdSettingDialogSingleton& getInstance();
	void show();
	void initValue(QString name, QString data_f, QByteArray data);

	CmdSettingDialogSingleton(CmdSettingDialogSingleton&) = delete;
	CmdSettingDialogSingleton(CmdSettingDialogSingleton&&) = delete;
	CmdSettingDialogSingleton& operator=(CmdSettingDialogSingleton&) = delete;
	CmdSettingDialogSingleton&& operator=(CmdSettingDialogSingleton&&) = delete;
signals:
	void cmd_setting_finished_signal(QString name, QString data_f, QByteArray data);
private:
	CmdSettingDialogSingleton();
	QDialog* cmd_dialog;
	QString name;
	QLineEdit* name_edit;
	QLineEdit* data_edit;
	QComboBox* hup_combo;
	QLineEdit* hup_cmd_edit;
	QRadioButton* text_radio;
	QRadioButton* hex_radio;
	QPushButton* sure;
	QPushButton* cancel;
	Cmd_Data old_cmd_data;
};